<?php
class SiteLinks extends CWidget
{
    public function run()
    {
        $defaultSiteId = Yii::app()->cmsManager->site['id'];
        $models = FSM::run('Cms.workflow.getListBySite', array('site_id'=>$defaultSiteId))->models;
        $items = array();
        foreach ($models as $model)
        {
            $items[] = array('label'=>$model->name, 'url'=>'http://'.$model->url, 'linkOptions'=>array('class'=>'MenuTextDrop', 'target'=>'_blank'));
        }
        if (count($items))
        {
            $this->controller->widget('zii.widgets.CMenu', array(
                'items'=>$items,
            ));
        }
    }
}